<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let str = `this 4/5 is 4.5 word 3.2`;

      // 自定义集合
      console.log(str.match(/[45od]/g));
      console.log(str.match(/[0123456789]/g));
      console.log(str.match(/[0-9]/g));
      console.log(str.match(/[4-8]/g));
      console.log(str.match(/[a-z]/g));
      console.log(str.match(/[A-Z]/g));
      console.log(str.match(/[h-r]/g));
      console.log(str.match(/[a-z0-9]/g));
    </script>
  </body>
</html>
